<%@page import="com.lang8.util.i18n.Resources"%>
<%@page import="java.util.*"%>
<%@page import="com.lang8.util.dict.LanguageDict"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/commoninclude.jsp" %>
<%
Locale locale = request.getLocale();
List<String[]> languageList = LanguageDict.getLanguageList(locale.toString());
String nativeLang = locale.getDisplayLanguage(Locale.US);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
	<form action="${ctx}/servlet/US?action=register" method="post">
		<table>
			<tr>
				<td><%=Resources.getResources(locale.toString(), "jsp.user.register.jsp.email") %></td>
				<td><input type="text" name="loginId" value=""/></td>
			</tr>
			<tr>
				<td>Password:</td>
				<td><input type="password" name="password" value=""/></td>
			</tr>
			<tr>
				<td>Nickname:</td>
				<td><input type="text" name="nickName" value=""/></td>
			</tr>
			<tr>
				<td>Native Language:</td>
				<td>
					<select name="nativeLang">
						<%for (String[] langKV : languageList) {%>
							<%if (nativeLang.equals(langKV[0])) { %>
						<option value="<%=langKV[0]%>" selected="selected"><%=langKV[1] %></option>
							<%} else { %>
						<option value="<%=langKV[0]%>"><%=langKV[1] %></option>
							<%} %>
						<%} %>
					</select>
				</td>
			</tr>
			<tr>
				<td>Learning Language:</td>
				<td>
					<select name="learningLang">
						<%for (String[] langKV : languageList) { %>
						<option value="<%=langKV[0]%>"><%=langKV[1] %></option>
						<%} %>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<input type="submit" value="Submit"/>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>